<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<h1><fmt:message key="booking.form.title"/></h1>

<%-- ajouter les message d'erreur --%>
<div id="messages">    
<c:if test="${! empty flowRequestContext.messageContext.allMessages}">
 <h2>Erreurs</h2>
    <ul>
    <c:forEach items="${flowRequestContext.messageContext.allMessages}" var="message">
        <li><fmt:message key="${message.source}" /> : ${message.text}</li>
    </c:forEach>
    </ul>
</c:if>

<form:form modelAttribute="booking">
	<input type="hidden" name="execution" value="${flowExecutionKey}">

    <fieldset>

    	<!-- infos personne -->
        <div class="form-row">
            <label for="person.firstName"><fmt:message key="person.firstName"/>:</label>
            <span class="input"><form:input path="person.firstName" /></span>
        </div>       
        <div class="form-row">
            <label for="person.lastName"><fmt:message key="person.lastName"/>:</label>
            <span class="input"><form:input path="person.lastName" /></span>
        </div>
        <div class="form-row">
            <label for="person.birthdate"><fmt:message key="person.birthdate"/>:</label>
            <span class="input"><form:input path="person.birthdate" /></span>
        </div>

        <!-- reservation -->
        <div class="form-row">
            <label for="date"><fmt:message key="date"/>:</label>
            <span class="input"><form:input path="date" /></span>
        </div>
        <div class="form-buttons">
            <div class="button">
                <input type="submit" id="save" name="_eventId_book" value="<fmt:message key="button.book"/>"/>&#160;
                <input type="submit" name="_eventId_cancel" value="<fmt:message key="button.cancel"/>"/>&#160;    
            </div>    
        </div>
    </fieldset>
</form:form>